package com.qimu.saiyou.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.qimu.saiyou.model.dto.competition.CompetitionQueryRequest;
import com.qimu.saiyou.model.entity.Competition;
import com.qimu.saiyou.model.vo.CompetitionVO;

import javax.servlet.http.HttpServletRequest;

/**
 * @author: FeiXiang
 * @description 针对表【competition(竞赛)】的数据库操作Service
 * @createDate 2024-02-25 16:40:08
 */
public interface CompetitionService extends IService<Competition> {
    /**
     * 校验
     *
     * @param competition
     * @param add
     */
    void validCompetition(Competition competition, boolean add);

    /**
     * 获取查询条件
     *
     * @param competitionQueryRequest
     * @return
     */
    QueryWrapper<Competition> getQueryWrapper(CompetitionQueryRequest competitionQueryRequest);

    /**
     * 获取帖子封装
     *
     * @param competition
     * @param request
     * @return
     */
    CompetitionVO getCompetitionVO(Competition competition, HttpServletRequest request);

    CompetitionVO getCompetitionVO(Competition competition);

    /**
     * 分页获取帖子封装
     *
     * @param competitionPage
     * @param request
     * @return
     */
    Page<CompetitionVO> getCompetitionVOPage(Page<Competition> competitionPage, HttpServletRequest request);
}
